Skip to content

fix: pass all scene data through mapInputProps to Remotion#635

Merged
codercatdev merged 5 commits intodevfrom
fix/pass-all-scene-data
Mar 13, 2026
Merged

fix: pass all scene data through mapInputProps to Remotion#635
codercatdev merged 5 commits intodevfrom
fix/pass-all-scene-data

Conversation

@codercatdev
Copy link
Contributor

Fix: Pass all scene data through mapInputProps to Remotion

Root Cause

mapInputProps() in remotion.ts was cherry-picking only 6 fields per scene:

// BEFORE — drops sceneType, code, list, comparison, mockup, wordTimestamps
scenes: input.script.scenes.map((s, i) => ({
  narration: s.narration,
  visualDescription: s.visualDescription,
  bRollKeywords: s.bRollKeywords,
  sceneNumber: s.sceneNumber,
  durationEstimate: s.durationEstimate,
  bRollUrl: input.bRollUrls[i],
})),

This caused every scene to fall through to the generic Scene component in SceneRouter, making all videos look like plain word overlays with B-roll — even though Gemini was generating rich scene data with comparison tables, code snippets, and mockups.

Fix

// AFTER — spreads all scene fields through to Remotion
scenes: input.script.scenes.map((s, i) => ({
  ...s,
  bRollUrl: input.bRollUrls[i],
})),

Also added missing fields to RenderInput type so TypeScript knows about them:

  • sceneType — routes to CodeMorph, DynamicList, ComparisonGrid, IsometricMockup, Infographic
  • code — snippet, language, highlightLines
  • list — items, icon
  • comparison — leftLabel, rightLabel, rows
  • mockup — deviceType, screenContent
  • wordTimestamps — per-word timing from ElevenLabs

Impact

All 6 scene types will now render correctly:

Scene Type Before After
narration ✅ worked ✅ works
code ❌ fell through to generic ✅ CodeMorphScene
list ❌ fell through to generic ✅ DynamicListScene
comparison ❌ fell through to generic ✅ ComparisonGridScene
mockup ❌ fell through to generic ✅ IsometricMockupScene
infographic ❌ fell through to generic ✅ InfographicScene

Scope

1 file: lib/services/remotion.ts — 7 insertions, 6 deletions.

Miriad and others added 5 commits March 13, 2026 02:34
Remove generateStaticParams() and associated unused imports (client, groq)
from all dynamic route pages. These were pre-rendering 450+ pages at build
time, creating massive ISR surface area that burned through Vercel's 200K
ISR write limit.

The site uses defineLive + SanityLive for real-time content updates,
making static pre-rendering unnecessary.

Files modified:
- app/(main)/(post)/post/[slug]/page.tsx
- app/(main)/(post)/blog/page/[num]/page.tsx
- app/(main)/(podcast)/podcast/[slug]/page.tsx
- app/(main)/(podcast)/podcasts/page/[num]/page.tsx
- app/(main)/(author)/author/[slug]/page.tsx
- app/(main)/(author)/authors/page/[num]/page.tsx
- app/(main)/(guest)/guest/[slug]/page.tsx
- app/(main)/(guest)/guests/page/[num]/page.tsx
- app/(main)/(sponsor)/sponsor/[slug]/page.tsx
- app/(main)/(sponsor)/sponsors/page/[num]/page.tsx
- app/(main)/(top-level-pages)/[slug]/page.tsx

Co-authored-by: research <research@miriad.systems>
Remove time-based ISR revalidation from all pages and sitemap.
These caused constant ISR writes on every visitor request:
- revalidate=60 on 7 listing pages (writes every minute per visitor)
- revalidate=3600 on 5 detail pages
- revalidate=86400 on 4 static pages
- revalidate=3600 on sitemap.ts

With defineLive + SanityLive handling real-time updates, time-based
ISR revalidation provides zero benefit while consuming ISR writes.

Files modified:
- app/(main)/page.tsx
- app/(main)/(post)/post/[slug]/page.tsx
- app/(main)/(post)/blog/page.tsx
- app/(main)/(post)/blog/page/[num]/page.tsx
- app/(main)/(podcast)/podcast/[slug]/page.tsx
- app/(main)/(podcast)/podcasts/page.tsx
- app/(main)/(podcast)/podcasts/page/[num]/page.tsx
- app/(main)/(author)/author/[slug]/page.tsx
- app/(main)/(author)/authors/page/[num]/page.tsx
- app/(main)/(guest)/guest/[slug]/page.tsx
- app/(main)/(guest)/guests/page/[num]/page.tsx
- app/(main)/(sponsor)/sponsor/[slug]/page.tsx
- app/(main)/(sponsor)/sponsors/page/[num]/page.tsx
- app/(main)/(top-level-pages)/[slug]/page.tsx
- app/(main)/(top-level-pages)/pro/page.tsx
- app/(main)/(top-level-pages)/sponsorships/page.tsx
- app/sitemap.ts

Co-authored-by: research <research@miriad.systems>
The webhook was firing revalidateTag("sanity") on EVERY Sanity document
change, including automated pipeline documents (automatedVideo,
contentIdea, sponsorLead, etc.) that update frequently via cron jobs.
Each webhook call invalidated ALL cached pages simultaneously.

Now skips internal/pipeline document types that have no public-facing
pages. For public content types, keeps revalidateTag("sanity") as a
fallback for when no active visitors trigger SanityLive updates.

Skipped types: automatedVideo, contentIdea, sponsorLead,
pipeline_config, content_config

Co-authored-by: research <research@miriad.systems>
The previous commit only removed imports but the sed pattern didn't
match the function bodies due to shell quoting issues with parentheses
in file paths. This commit removes the actual function bodies from all
11 pages.

Co-authored-by: research <research@miriad.systems>
mapInputProps() was cherry-picking only 6 fields per scene, dropping
sceneType, code, list, comparison, mockup, and wordTimestamps. This
caused SceneRouter to fall through to the generic Scene component for
every scene, making all videos look like plain word overlays.

Fix: spread the full scene object (...s) instead of cherry-picking.
Added missing fields to RenderInput type: sceneType, code, list,
comparison, mockup, wordTimestamps.
@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
codingcat-dev Ignored Ignored Mar 13, 2026 2:37am

@codercatdev codercatdev merged commit f7dacee into dev Mar 13, 2026
2 of 3 checks passed
@codercatdev codercatdev deleted the fix/pass-all-scene-data branch March 13, 2026 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant